define(function (require, exports, module) {
	ValidateUtils=function(){}
	ValidateUtils.lengthValidate=function(content,regStr,textType){
		var content=content;
		if(typeof(content)!="string"){content=content.toString()||String(content);}
		if(arguments.length==3&&!textType){console.log("ValidateUtil");return false;}
		r=/[;\&\<\>\(\)'\|\$\%\@\+\\\r\n\"]+/;
		console.log(r.test(content));
		if(r.test(content)){
			content=ValidateUtils.replaceUnXssAll(content);
		}
		var regStr=regStr.replace(/\@/g,"&#64;")
		var rex=new RegExp(regStr);
		console.log(content);
		return rex.test(content);
	}
	ValidateUtils.replaceUnXssAll=function(unxss){
		unxss = unxss.replace(/;/g,"&#59;");//; &#59;
		unxss = unxss.replace(/&/g,"&amp;");//&amp; 符号
        unxss = unxss.replace( /</g,"&lt;").replace(/>/g,"&gt;");//<>（尖括号）
        unxss = unxss.replace(/\(/g,"&#40;").replace(/\)/g,"&#41;");//()（括号）
        unxss = unxss.replace(/'/g,"&#39;");//\\'（反斜杠转义单引号）
        unxss = unxss.replace(/\|/g,"&brvbar;" );//| &#166; &brvbar;
        unxss = unxss.replace(/\$/g,"&#36;");//$ &#36;
        unxss = unxss.replace(/\%/g,"&#37;");//% &#37;
        unxss = unxss.replace(/\@/g,"&#64;");//@（at 符号） @ &#64; 
        unxss = unxss.replace(/\+/g,"&#43;");//+ &#43
        unxss = unxss.replace(/,/g,"&#44;");
        unxss = unxss.replace(/\\/g,"&#92;");//\ &#92;
        unxss = unxss.replace(/\r/g,"&#13;");//\r 回车
        unxss = unxss.replace(/\n/g,"&#10;");//\n 换行
        unxss = unxss.replace(/\"/g,"&#34;");
		return unxss;
	}
	module.exports = ValidateUtils;
});